<?php

use Illuminate\Http\Request;
use Illuminate\Routing\Router;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});


//登录接口
Route::namespace('Api')->group(function () {

    Route::post('login', 'AuthController@login');
    Route::post('refresh', 'AuthController@refresh');
    Route::post('me', 'AuthController@me');

    Route::get('me1', 'CardController@me');

    //活动模块
    Route::get('video/list', 'VideoController@getVideo');
    Route::get('article/list', 'ArticleController@getAllArticle');
    Route::get('article/detail', 'ArticleController@getDetailArticle');

    //
    Route::get('card/list', 'CardController@cardList');
    Route::get('card/detail', 'CardController@getDetailCard');
    Route::get('card/getCause', 'ClassCardController@getDetailHour')->middleware('checkToken');

//老师
    Route::get('tea/list', 'TeaController@getTeaList');

    Route::get('user/list', 'UserController@getUserList');
    //修改
    Route::post('user', 'UserController@editUser')->middleware('checkToken');
    //报名
//    Route::post('user/apply', 'UserController@apply');
    Route::post('user/apply', 'UserController@apply')->middleware('checkToken');
    //绑定家长信息
    Route::post('user/bindUser', 'UserController@bindUser');
    //当前用户详情
    Route::get('user/detail', 'UserController@getDetailUser');
    Route::get('user/getMyOrder', 'UserController@getMyOrder');
    Route::get('user/userInfo', 'UserController@userInfo')->middleware('checkToken');
    Route::get('user/getLevel', 'UserController@getLevel')->middleware('checkToken');

    //请假
    Route::post('user/setCourse', 'CauseController@setCourse')->middleware('checkToken');

    //修课
    Route::post('user/levCourse', 'CauseController@levCourse')->middleware('checkToken');





    Route::get('user/getDetailSport', 'SportTestController@getDetailSport');
    Route::put('user/switchSport', 'SportTestController@switchSport')->middleware('checkToken');



    Route::get('team/list', 'TeamController@getTeamList');
    Route::get('team/detail', 'TeamController@getTeamDetail');
    Route::get('team/getPlayers', 'TeamController@getPlayers');

    //
    Route::get('setting', 'SettingController@getSetting');

    //短信發送
    Route::post('smsBind', 'SmsController@smsBind');
    Route::post('upload', 'UploadController@upload');
    Route::get('home', 'HomeController@home');


    //脚本
    Route::get('CutClass', 'ScriptController@CutClass');//扣课时
    Route::get('smsNotice', 'ScriptController@smsNotice');//每天上课发短信
    Route::get('isOver', 'ScriptController@isOver');//判断是否过期省份
    Route::get('overTime', 'ScriptController@overTime');//定时任务还剩下7个课时9点发送


});


